package com.eascs.web.o2o.scheduler.quartz;

import com.eascs.app.log.Logger;
import com.eascs.app.log.LoggerFactory;
import com.eascs.web.o2o.quartz.util.BaseJobUtil;
import com.eascs.web.o2o.quartz.util.ExecutorService;
import com.eascs.web.o2o.scheduler.service.*;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.inject.Inject;

/**
 * @author user
 * @version V1.0 TODO(定时同步) 2017年1月5日 下午1:53:44
 */
@Component("ReportQuartz")
public class ReportQuartz extends BaseJobUtil{
	
	protected final Logger logger = LoggerFactory.getLogger(getClass());
	@Inject
	DataCenterService dataCenterService;
	@Inject
	CustomerShopInfoService customerShopInfoService;
	@Autowired
	DayReportService dayService;
	
	
	public void saveCustomerShopInfo() {
		executor("ReportQuartz", "saveCustomerShopInfo", "门店信息同步", new ExecutorService() {
			@Override
			public void exe() {
				customerShopInfoService.saveCustomerShopInfo();
			}
		});
	}

	public void bankAndprocess() {
		executor("ReportQuartz", "bankAndprocess", "管理层日报一期-业务进度日报表", new ExecutorService() {
			@Override
			public void exe() {
				dayService.saveReportLoanIngFromService();
				dataCenterService.saveReportPingtaiDelivery();
			}
		});
	}

	public void processMonitorReport() {
		executor("ReportQuartz", "processMonitorReport", "省区流程监控表数据", new ExecutorService() {
			@Override
			public void exe() {
				dataCenterService.processMonitorReport();
			}
		});
	}


}
